<template>
  <div class="login-wrapper">
    <el-card class="login-card">
      <div class="login-header">
        <img src="@/assets/logo.png" alt="logo" class="login-logo" />
        <h2>体检管理系统</h2>
        <p class="welcome-text">欢迎登录体检管理系统，请输入您的账号信息</p>
      </div>
      <el-form @submit.native.prevent="login" class="login-form">
        <el-form-item label="用户名">
          <el-input v-model="username" placeholder="请输入用户名" />
        </el-form-item>
        <el-form-item label="密码">
          <el-input type="password" v-model="password" placeholder="请输入密码" />
        </el-form-item>
        <el-form-item>
          <button class="login-btn" @click="login">登录</button>
        </el-form-item>
      </el-form>
      <div class="login-footer">
        <span>忘记密码？请联系管理员</span>
        <span class="tips">建议使用最新版本的 Chrome 浏览器获得最佳体验</span>
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      username: "",
      password: "",
    };
  },
  methods: {
    login() {
      if (this.username === "123" && this.password === "123") {
        this.$emit("login-success");
      } else {
        this.$message.error("用户名或密码错误");
      }
    },
  },
};
</script>
<style scoped>
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #e0e7ff 0%, #f8fafc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  max-width: 400px;
  width: 100%;
  padding: 32px 24px 16px 24px;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  background: #fff;
}
.login-header {
  text-align: center;
  margin-bottom: 24px;
}
.login-logo {
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
}
.welcome-text {
  color: #64748b;
  font-size: 15px;
  margin-top: 4px;
  margin-bottom: 0;
}
.login-form {
  margin-bottom: 8px;
}
.login-btn {
  width: 100%;
  background: linear-gradient(90deg, #6366f1 0%, #60a5fa 100%);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 0;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.login-btn:hover {
  background: linear-gradient(90deg, #4f46e5 0%, #2563eb 100%);
}
.login-footer {
  margin-top: 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}
.login-footer .tips {
  display: block;
  margin-top: 4px;
  color: #a1a1aa;
}
</style>